package cn.buk.tms.entity.order.hotel;

import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.ForeignKey;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import jakarta.persistence.Temporal;
import jakarta.persistence.TemporalType;

/**
 * @Author yfdai
 * @Date 2019-7-27
 */
@Entity
@Table(name = "hotel_order_psg")
public class HotelOrderPassenger {


    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    private int id;

    @Column(name = "enterprise_id")
    private int enterpriseId;

    @ManyToOne
    @JoinColumn(name="order_id", foreignKey = @ForeignKey(name = "fk_hotel_order_id"))
    private HotelOrder orderInfo;

    /**
     * 乘客姓名
     */
    @Column(length = 50)
    private String name;

    /**
     * 证件类型
     */
    private int idType;

    /**
     * 证件号
     */
    @Column(length = 50)
    private String idNo;

    /**
     * 手机
     */
    @Column(length = 20)
    private String mobile;

    /**
     * 保存数据库的时间：系统自动生成
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="create_time", insertable = false, updatable = false)
    private Date createTime;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "last_update", insertable = false)
    private Date lastUpdate;


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getEnterpriseId() {
        return enterpriseId;
    }

    public void setEnterpriseId(int enterpriseId) {
        this.enterpriseId = enterpriseId;
    }



    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }



    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIdType() {
        return idType;
    }

    public void setIdType(int idType) {
        this.idType = idType;
    }

    public String getIdNo() {
        return idNo;
    }

    public void setIdNo(String idNo) {
        this.idNo = idNo;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public HotelOrder getOrderInfo() {
        return orderInfo;
    }

    public void setOrderInfo(HotelOrder orderInfo) {
        this.orderInfo = orderInfo;
    }
}
